updating oE Safe Mode Summary

Safe Mode

Safe Mode Summary

During the development of your application, you can define the word SAFE to cause machine.e to use alternative memory functions. These functions are slower but help in the debugging stages. In general, SAFE mode should not be enabled during production phases but only for development phases.

To define the word SAFE run your application with the -D SAFE command line option, or add to the top of your main file:

with define safe 

before the first appearance of include std/machine.e

The implementation of the Machine Level Access routines used are controled with the define word SAFE. The use of SAFE switches the routines included here to use debugging versions which will allow you to catch all kinds of bugs that might otherwise may not always crash your program where in the line your program is written. There may be bugs that are invisible until you port the program they are in to another platform. There has been no bench marking for how much of a speed penalty there is using SAFE.

You can take advantage of SAFE debugging by:

  • If necessary, call register_block(address, length, memory_protection) to add additional "external" blocks of memory to the safe_address_list. These are blocks of memory that are safe to use but which you did not acquire through Euphoria's allocate, allocate_data, allocate_code or allocate_protect, allocate_string, allocate_wstring. Call unregister_block(address) when you want to prevent further access to an external block. When SAFE is not enabled these functions will do nothing and will be converted into nothing by the inline code in the front-end.
  • You will be notified if memory that you haven't allocated is accessed, or if memory is freed twice, or if memory is used in the wrong way. Your application will can be ready for D.E.P. enabled systems even if the system you test on doesn't have D.E.P..
  • If a bug is caught, you will hear some "beep" sounds. Press Enter to clear the screen and see the error message. There will be a descriptive crash message and a traceback in ex.err so you can find the statement that is making the illegal memory access.
Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu